#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

int lengthOfLastWord(char* s);

int main()
{
	char* s = "Hello World";
	lengthOfLastWord(s);
	return 0;
}

int lengthOfLastWord(char* s)
{
	int left = 0, right = 0, end = 0;
	while (s[end] == ' ') end++;
	while (s[end]) {
		left = end;
		while (s[end] && s[end] != ' ') end++;
		right = end;
		while (s[end] == ' ') end++;
	}

	return right - left;
}
